package com.graduation.controller;

import com.graduation.service.PromotionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description 促销活动实体类
 * @Author YaoQi
 * @Date 2018/3/20 0:10
 */
@RestController
@RequestMapping("/promotion")
public class PromotionController {

    @Autowired
    private PromotionService promotionService;

    /**
     * 获取所有的活动
     *
     * @return 返回list
     */
    @RequestMapping("/getList.json")
    public Map getPromotionList() {

        Map<String, Object> returnMap = new HashMap<>();
        returnMap.put("promotionList", promotionService.listPromotion());
        return returnMap;
    }
}
